package com.gzc.just.play.last.war.sceneserver.skill;

/**
 * 技能类型枚举
 * 
 * @author AI Assistant
 * @version 1.0.0
 * @since 2025-11-22
 */
public enum SkillType {
    NORMAL_ATTACK(1, "普通攻击", "单体伤害"),
    SINGLE_TARGET(2, "单体技能", "对单个目标造成伤害"),
    AOE(3, "群体技能", "对范围内所有敌方造成伤害"),
    BUFF(4, "增强技能", "增强友方单位属性"),
    DEBUFF(5, "减弱技能", "削弱敌方单位属性"),
    HEAL(6, "治疗技能", "恢复生命值"),
    CONTROL(7, "控制技能", "对敌方造成控制效果"),
    UTILITY(8, "辅助技能", "其他辅助效果"),
    ULTIMATE(9, "大招技能", "终极技能"),
    UNKNOWN(0, "未知技能", "未知");

    private final int code;
    private final String name;
    private final String description;

    SkillType(int code, String name, String description) {
        this.code = code;
        this.name = name;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据编码获取技能类型
     */
    public static SkillType fromCode(int code) {
        for (SkillType type : SkillType.values()) {
            if (type.code == code) {
                return type;
            }
        }
        return UNKNOWN;
    }

    /**
     * 是否是伤害类技能
     */
    public boolean isDamageSkill() {
        return this == NORMAL_ATTACK || this == SINGLE_TARGET || this == AOE || this == CONTROL || this == ULTIMATE;
    }

    /**
     * 是否是治疗类技能
     */
    public boolean isHealSkill() {
        return this == HEAL || this == BUFF;
    }

    /**
     * 是否是群体技能
     */
    public boolean isAOE() {
        return this == AOE;
    }
}
